package com.ap.core.ldap.domain;


import java.util.ArrayList;
import java.util.List;

/**
 * Base class for ldap user
 */
public class BaseLdapUser {

    private LdapAttribute<String> commonName = new LdapAttribute<>("cn");
    private LdapAttribute<String> firstName =  new LdapAttribute<>("givenname");
    private LdapAttribute<String> lastName = new LdapAttribute<>("sn");

    public LdapAttribute<String> getCommonName() {
        return commonName;
    }

    public void setCommonName(String commonName) {
        this.commonName.setLdapAttributeValue(commonName);
    }

    public LdapAttribute<String> getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName.setLdapAttributeValue(firstName);
    }

    public LdapAttribute<String> getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName.setLdapAttributeValue(lastName);
    }

    public List<LdapAttribute<?>> getLdapAttributes(){
        final List<LdapAttribute<?>> attributes = new ArrayList<>();
        attributes.add(commonName);
        attributes.add(firstName);
        attributes.add(lastName);
        return attributes;
    }

}
